let count=parseInt(inut_arr[0])
let student_exam_infos=[]
for(i=0;i<count;i++){
    let arr=input_arr[i+1].split(' ')
    let student_exam_object={
        exam_no:arr[0],
        tryseat:arr[1],
        examseat:arr[2],
    }
        student_exam_infos.push(student_exam_object)

}
    let query_no=ipnt_arr[input_arr-1]
    let query_arr=query_no.split(' ')
     for(let search_no of query_arr){
let tmp_arr=student_exam_infos.filter((item)=>{return item.teyseat===search_no})
console.log(`${tmp_arr[0].exm_no}${tmp_arr[0].examseat}`);
}